package xyz.zdsoft.course_manage_module.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zdsoft.common.utils.ResultBody;
import xyz.zdsoft.course_manage_module.bo.CourseInfoBo;
import xyz.zdsoft.course_manage_module.bo.CourseStudentInfoBo;
import xyz.zdsoft.course_manage_module.service.TeacherCourseService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author 王林
 * @version 1.0
 * @date 2021-07-22 周四
 * @time 11:03
 * @description
 */
@Api(tags = "老师课程管理")
@RestController
@RequestMapping("api/teacher/course")
public class TeacherCourseController {

    @Resource
    private TeacherCourseService teacherCourseService;


    @ApiOperation(value = "根据条件查询与老师相关的课程安排")
    @GetMapping("/getAllCourse")
    @ApiOperationSupport(ignoreParameters = {"studentId","teacherId"})
    public ResultBody selectCourse(CourseInfoBo courseInfoBo, HttpServletRequest request) {

        return teacherCourseService.queryAllCourse(courseInfoBo, request);
    }

    // 根据课程id查询学生 - 在项目课程表页面的“查看学生”按钮，查询该课程下的所有学生
    @ApiOperation(value = "根据课程id查询该课程下的所有学生")
    @GetMapping("/getCourseStudentInfo")
//    @ApiImplicitParam(name = "teamName",value = "小组名称",dataType = "String")
    public ResultBody queryCourseStudent(CourseStudentInfoBo courseStudentInfoBo) {

        return teacherCourseService.queryCourseStudent(courseStudentInfoBo);
    }

}
